package com.yilin.xbr.dao.member;

import com.yilin.xbr.core.base.BaseDao;
import com.yilin.xbr.entity.member.Account;
import org.springframework.stereotype.Repository;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Repository
public class AccountDao extends BaseDao<Account> {


    public Account getAccount(String accountId) {
//        String hql = "FROM Account account WHERE account.id=:accountId";
//        Map<String,Object> map =new HashMap<>();
//        map.put("accountId",accountId);
//        return  getObjectByColumn(hql,map);
        return getObjectById(Account.class,accountId);
    }
    public List<Account> accountAll(String id){
        String sql="SELECT * FROM  Account account WHERE account.id:id";
        Map<String,Object> map=new HashMap<>();
        map.put("id",id);

        return  getListBySQL(sql,map);
    }

}
